{"id":19027328,"url":"https://github.com/tilotech/tilores-langchain","last_synced_at":"2025-10-06T10:32:36.386Z","repository":{"id":261628485,"uuid":"884865782","full_name":"tilotech/tilores-langchain","owner":"tilotech","description":"This repository provides the building blocks for integrating LangChain, LangGraph, and the Tilores entity resolution system.","archived":false,"fork":false,"pushed_at":"2024-11-21T13:52:19.000Z","size":36,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-16T13:11:13.461Z","etag":null,"topics":["agentic-rag","entity-resolution","identity-resolution","langchain"],"latest_commit_sha":null,"homepage":"htttps://tilores.io/RAG","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tilotech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-07T14:28:01.000Z","updated_at":"2025-01-12T18:30:18.000Z","dependencies_parsed_at":"2024-11-07T15:59:30.380Z","dependency_job_id":null,"html_url":"https://github.com/tilotech/tilores-langchain","commit_stats":null,"previous_names":["tilotech/tilores-langchain"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilotech%2Ftilores-langchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilotech%2Ftilores-langchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilotech%2Ftilores-langchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilotech%2Ftilores-langchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tilotech","download_url":"https://codeload.github.com/tilotech/tilores-langchain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235519887,"owners_count":19003201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-rag","entity-resolution","identity-resolution","langchain"],"created_at":"2024-11-08T21:07:57.606Z","updated_at":"2025-10-06T10:32:31.102Z","avatar_url":"https://github.com/tilotech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LangChain Using Tilores\n\nThis repository provides the building blocks for integrating LangChain, LangGraph, and the\n[Tilores entity resolution system](https://docs.tilotech.io/tilores/).\n\nDevelopers can use these tools to create powerful systems that leverage entity resolution\nfor record retrieval, search, and entity resolution.\n\n## Examples\n\n* **Human-in-the-Loop Chat:** [`examples/chat`](https://github.com/tilotech/tilores-langchain/tree/main/examples/chat)\n\n    This example demonstrates how to build a chat application using Chainlit and LangGraph to explore a Tilores instance through natural language. It guides users through search functionality and explains the search results.\n\n* **Basic Usage:** [`examples/basic`](https://github.com/tilotech/tilores-langchain/tree/main/examples/basic)\n\n    This example shows how to use tools with an LLM model in a basic setup.\n\n## Usage\n\n```python\nfrom tilores import TiloresAPI\nfrom tilores_langchain import TiloresTools\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.messages import HumanMessage\n\n# Initialize the Tilores API.\ntilores = TiloresAPI.from_environ()\n# TiloresTools helps you build typed tools from a specific Tilores instance, typed according to\n# the schema of the instance.\ntilores_tools = TiloresTools(tilores)\n\n# Setup a LLM model for inference bound with a set of tools.\ntools = [tilores_tools.search_tool]\ntools_dict = {tool.name: tool for tool in tools}\nmodel = ChatOpenAI(temperature=0, streaming=True, model_name=\"gpt-4o\")\nmodel = model.bind_tools(tools)\n\n# The basic loop works like this, that a list of messages is passed to the LLM\nmessages = [\n    HumanMessage(\"Find me an entity by the first name Emma, surname Schulz, born on 1988-03-12\")\n]\nai_message = model.invoke(messages)\nmessages.append(ai_message)\n\n# And for each AiMessage, you must check if it wants to invoke tools.\nfor tool_call in ai_message.tool_calls:\n    # Perform the tool call and append the ToolMessage to the list of messages\n    selected_tool = tools_dict[tool_call['name']]\n    tool_message = selected_tool.invoke(tool_call)\n    messages.append(tool_message)\n\n# Then continue the basic loop by invoking the LLM with the current state, passing the list of messages.\nai_response = model.invoke(messages)\nprint(ai_response.content)\n```\n\n```console\n$ cd examples/basic/\n$ pip install -r requirements.txt\n$ python llm_with_tools.py\nI found multiple records for an entity with the first name Emma, surname Schulz, born on 1988-03-12. Here are the details:\n\n1. **Record ID:** cc001001-0006-4000-c000-000000000006\n   - **First Name:** Emma\n   - **Last Name:** Schulz\n   - **Date of Birth:** 1988-03-12\n\n2. **Record ID:** cc001001-0002-4000-c000-000000000002\n   - **First Name:** Emma\n   - **Last Name:** Schulz\n   - **Date of Birth:** 1988-03-12\n\n[... snip ...]\n\nIf you need more specific information or further assistance, please let me know!\n```\n\n## Provided tools\n\n- [x] `tilores_search`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilotech%2Ftilores-langchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftilotech%2Ftilores-langchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilotech%2Ftilores-langchain/lists"}