https://github.com/getretake/retake Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Customer Stories + White papers, Ebooks, Webinars + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. {{ message }} getretake / retake Public * Notifications * Fork 10 * Star 282 Open-Source Hybrid Search for Postgres getretake.com License Apache-2.0 license 282 stars 10 forks Activity Star Notifications * Code * Issues 13 * Pull requests 1 * Discussions * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Projects * Security * Insights getretake/retake This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. dev Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 6 branches 22 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/g] Use Git or checkout with SVN using the web URL. [gh repo clone getret] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @rebasedming rebasedming fix: Update README title (#210) ... b89ce11 Aug 10, 2023 fix: Update README title (#210) b89ce11 Git stats * 140 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github api assets clients core docker docs examples submodules sync tests .flake8 .gitignore .gitmodules CODE_OF_CONDUCT.md CONTRIBUTING.md Caddyfile LICENSE README.md SECURITY.md deploy.sh mypy.ini poetry.lock pyproject.toml pytest.ini View code [ ] Retake Documentation * Website Usage Python Typescript Key Features How Retake Works Contributing License README.md Retake Retake Open-Source Hybrid Search for Postgres Documentation * Website Stars Release License Retake is the fastest way to unlock keyword + semantic search for your database. By connecting directly to Postgres, Retake accelerates the development of AI applications that require searching, matching, or analyzing database documents. Retake also provides simple search SDKs that snap into any Python or Typescript application. You don't need to worry about managing separate vector stores and text search engines, uploading and embedding documents, or reindexing data. Just write search queries and let Retake handle the rest. To get started, run our Docker Compose file: git clone git@github.com:getretake/retake.git cd retake/docker docker compose up By default, this will start the Retake engine at http:// localhost:8000 with API key retake-test-key. Usage Python Install the SDK pip install retakesearch The core API is just a few functions. from retakesearch import Client, Index, Database, Table, Search client = Client(api_key="retake-test-key", url="http://localhost:8000") database = Database( host="***", user="***", password="***", port=5432 dbname="***" ) columns = ["column1"] table = Table( name="table_name", columns=columns ) index = client.create_index("my_index") # Note: The table must have a primary key index.add_source(database, table) index.vectorize(columns) # Keyword (BM25) search query = Search().query("match", column1="my query") response = index.search(query) # Semantic (vector-based) search query = Search().with_semantic("my_query", columns) response = index.search(query) # Neural (keyword + semantic) search query = Search().with_neural("my_query", columns) response = index.search(query) print(response) Typescript Install the SDK npm install retake-search The core API is just a few functions. import { Client, Database, Table, Search } from "retake-search"; import { withSemantic, withNeural, matchQuery } from "retake-search/helpers"; const client = new Client("retake-test-key", "http://localhost:8000"); // Replace with your database credentials const columns = ["column_to_search"]; const database = new Database({ host: "***", user: "***", password: "***", dbName: "***", port: 5432, }); const table = new Table({ table: "table_name", columns: columns, }); const index = client.create_index("table_name"); // Note: The table must have a primary key index.addSource(database, table); index.vectorize(columns); // Keyword (BM25) search const bm25Query = Search().query(matchQuery("column_to_search", "my query")); index.search(bm25Query); // Semantic (vector-based) search const semanticQuery = Search().query(withSemantic("my query", columns)); index.search(semanticQuery); // Neural (keyword + semantic) search const neuralQuery = Search().query(withNeural("my query", columns)); index.search(neuralQuery); Key Features Always in Sync Retake leverages logical-replication-based Change-Data-Capture (CDC) to integrate directly with Postgres. As data changes or new data arrives, Retake ensures that the indexed data is kept in sync. Intelligent Vector Cache Whenever data is changed in Postgres, Retake also updates the embedding/vector representation of that data behind the scenes. Vectors are automatically cached for lightning-fast query results with semantic understanding. Low-Code SDK Retake provides intuitive search SDKs that drop into any Python or Typescript application (other languages coming soon). The core API is just a few functions. [?] Open/ElasticSearch DSL Compatible Retake enables developers to query with the full expressiveness of the OpenSearch DSL (domain-specific language). Deployable Anywhere Retake is deployable anywhere, from a laptop to a distributed cloud system. How Retake Works A detailed overview of Retake's architecture can be found in our documentation. Contributing For more information on how to contribute, please see our Contributing Guide. License Retake is licensed under the Apache-2.0 License. About Open-Source Hybrid Search for Postgres getretake.com Topics python elasticsearch postgres data kafka pipeline postgresql embeddings data-engineering data-integration vectors change-data-capture data-ingestion opensearch mlops vector-search vector-database neuralsearch embeddings-similarity llms Resources Readme License Apache-2.0 license Code of conduct Code of conduct Security policy Security policy Activity Stars 282 stars Watchers 5 watching Forks 10 forks Report repository Releases 22 v0.1.31 Latest Aug 10, 2023 + 21 releases Packages 0 No packages published Used by 26 * @mindmeand * @hyunsungKR * @Yunwltn * @Yunwltn * @hyunsungKR * @hyunsungKR * @Yunwltn * @Yunwltn + 18 Contributors 3 * * * Languages * Python 71.0% * TypeScript 20.1% * Shell 6.8% * JavaScript 1.2% * Dockerfile 0.9% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.