{"id":26238807,"url":"https://github.com/ceramicstudio/orbis-lit-langchain","last_synced_at":"2026-04-27T14:31:30.432Z","repository":{"id":268619589,"uuid":"904948152","full_name":"ceramicstudio/orbis-lit-langchain","owner":"ceramicstudio","description":"A basic starter project using OrbisDB for vector storage, Langchain for embeddings and querying, and Lit Protocol for access control.","archived":false,"fork":false,"pushed_at":"2025-03-24T23:28:33.000Z","size":2220,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-29T14:23:52.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceramicstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-17T21:25:57.000Z","updated_at":"2024-12-20T18:30:02.000Z","dependencies_parsed_at":"2024-12-17T22:45:36.358Z","dependency_job_id":null,"html_url":"https://github.com/ceramicstudio/orbis-lit-langchain","commit_stats":null,"previous_names":["ceramicstudio/orbis-lit-langchain"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ceramicstudio/orbis-lit-langchain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Forbis-lit-langchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Forbis-lit-langchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Forbis-lit-langchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Forbis-lit-langchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceramicstudio","download_url":"https://codeload.github.com/ceramicstudio/orbis-lit-langchain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Forbis-lit-langchain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32341447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-03-13T06:18:58.499Z","updated_at":"2026-04-27T14:31:30.415Z","avatar_url":"https://github.com/ceramicstudio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OrbisDB, Lit Protocol, and Langchain Starter\n\nThis is a basic starter project for building with the following tools and APIs:\n\n- Next.js\n- LangchainJS\n- GPT3\n- OrbisDB\n- Lit Protocol\n\n### What we're building\n\nWe are building an app that takes text (text files), embeds them into vectors, stores them into OrbisDB, and allows semantic searching of the data.\n\nWe've also enabled data privacy using Lit Protocol to encrypt the corresponding text for each embedding, and programmatically decrypt based on specified access control conditions.\n\n## Running the app\n\nIn this section I will walk you through how to deploy and run this app.\n\n### Prerequisites\n\nTo run this app, you need the following:\n\n1. An [OpenAI](https://platform.openai.com/) API key\n2. A modified [OrbisDB] instance (outlined below)\n3. Docker\n4. A [Lit](https://www.litprotocol.com/) token ID (also shown below)\n\n## Initial Setup\n\nTo run the app locally, follow these steps:\n\n1. Clone this repo and install the dependencies\n\n```sh\ngit clone https://github.com/ceramicstudio/orbis-lit-langchain\ncd orbis-lit-langchain\nyarn install\n```\n\n2. In a separate terminal, clone this modified version of OrbisDB and install the dependencies\n\n```sh\ngit clone https://github.com/mzkrasner/orbisdb\ncd orbisdb\nnpm install\n```\n\n3. In your orbisdb terminal, start the database process\n\n```sh\n# Ensure that you have your Docker Daemon running in the background first\nnpm run dev\n```\n\nYour OrbisDB instance will need to initially be configured using the GUI running on `localhost:7008`. Navigate to this address in your browser and follow these steps:\n\na. For \"Ceramic node URL\" enter the following value: `https://ceramic-orbisdb-mainnet-direct.hirenodes.io/`\n\nThis is the default public Ceramic node that the hosted Orbis Studio uses. We will leverage this to avoid the setup of a local Ceramic node\n\nb. For \"Ceramic Seed\" simply click \"generate a new one\" and go to the next page\n\nc. For \"Database configuration\" enter the following:\n\n```sh\nUser=postgres\nDatabase=postgres\nPassword=postgres\nHost=localhost\nPort=5432\n```\n\nThese are the default configurations your Docker image is using. Entering them here enables you to configure your OrbisDB instance to index Ceramic stream data using your dockerized Postgres instance.\n\nGo to the next page\n\nd. Click next on the presets page (do not select anything)\n\ne. Connect with your Metamask account and click \"Get started\". Keep the Orbis Studio UI in your browser as we will navigate back to it later\n\n4. Go to your `orbis-lit-langchain` terminal and copy the example env file\n\n```sh\ncp .env.example.local .env.local\n```\n\n5. Navigate to your browser running the OrbisDB UI and create a new context. You can call this anything you want. Once saved, click into your new context and copy the value prefixed with \"k\" into your `.env.local` file\n\n```sh\nCONTEXT_ID=\"\u003cyour-context-id\u003e\"\n```\n\nContexts allow developers to organize their data across different applications or projects. When this application uses the Orbis SDK to write embeddings, it will leverage this context when making the write request\n\n6. Next, we will create an OrbisDB seed to self-authenticate onto the Ceramic Network using the Orbis SDK\n\n```sh\nyarn gen-seed\n```\n\nThis is the seed the Orbis SDK will use to self-authenticate your OrbisDB client onto the Ceramic Network in order to perform writes.\n\nCopy only the array of numbers into your `.env.local` file\n\n```sh\n# enter as a string like \"[2, 19, 140, 10...]\"\nORBIS_SEED=\"your-array-here\"\n```\n\nMake sure the final number in your array does not contain a trailing comma\n\n7. Copy an active and funded OpenAI API key into your `.env.local` file next to `OPENAI_API_KEY`\n\n8. Choose or create a dummy Metamask address and claim Lit Protocol Testnet tokens using that address by visiting `https://chronicle-yellowstone-faucet.getlit.dev/`\n\n9. Navigate to `https://explorer.litprotocol.com/` in your browser and sign in with the same dummy address as the previous step. Once signed in, click \"Mint a new PKP\". After minting, copy the value under \"Token ID\" into your `.env.local` file\n\n```sh\nLIT_TOKEN_ID=\"\u003cyour-token-id\u003e\"\n```\n\n10. Grab the private key from your dummy Metamask wallet (used in the two steps above) and enter it into your `.env.local` file\n\n```sh\nETHEREUM_PRIVATE_KEY=\"\u003cyour-private-key\u003e\"\n```\n\n11. Finally, deploy your OrbisDB data model we will use to create and query via vector search\n\n```sh\nyarn deploy-model\n```\n\nThis create a new \"table\" in your OrbisDB instance by creating a Ceramic model stream using the model definition found in [scripts/deploy-model.mjs](./scripts/deploy-model.mjs) on line 15.\n\nCopy the value prefixed with \"k\" into your `.env.local` file\n\n```sh\nTABLE_ID=\"\u003cyour-table-id\u003e\"\n```\n\n## Running the Application\n\nNow that our environment is configured, run the following to start the application from within your `orbis-lit-langchain` terminal\n\n```sh\nyarn dev\n```\n\nMake sure that OrbisDB is still running in your other terminal.\n\nNavigate to `localhost:3000` in your browser. \n\n### Create embeddings\n\nThis repository contains a small portion of the [Ceramic Developer Docs](https://developers.ceramic.network/) (specifically information on Decentralized Identifiers) that the application will use to create encrypted embeddings. Feel free to replace this with other documentation if you wish\n\nClick on \"Create index and embeddings\" and observe your terminal logs in both your `orbisdb` and `orbis-lit-langchain` terminals. \n\nOnce finished, your browser console will notify you that the data has been successfully created and loaded into OrbisDB.\n\n### Run a query \n\nSince the dataset is limited to special knowledge about DIDs, try the following query\n\n`tell me about decentralized identifiers in ceramic`\n\nSince this is knowledge contained in the embeddings we just created, your LLM's response will find these embeddings based on cosine similarity search and use it as context in the response (after decrypting the values). You can observe your terminal's logs to see what decrypted context it's using.\n\n**Ensure that the dummy wallet you spun up contains 0.000001 ETH or more**\n\n## Access control\n\nAt the moment, very simple access control conditions are being leveraged based on whether the wallet trying to read the data contains \u003e=0.000001 ETH (found in [utils](./utils.ts))\n\n```typescript\nconst accessControlConditions = [\n  {\n    contractAddress: \"\",\n    standardContractType: \"\",\n    chain: \"ethereum\",\n    method: \"eth_getBalance\",\n    parameters: [\":userAddress\", \"latest\"],\n    returnValueTest: {\n      comparator: \"\u003e=\",\n      value: \"1000000000000\", // 0.000001 ETH\n    },\n  },\n];\n```\n\nThere is a wide array of access control conditions you can use or create. For more information, visit [Lit's Access Control documentation](https://developer.litprotocol.com/sdk/access-control/intro).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceramicstudio%2Forbis-lit-langchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceramicstudio%2Forbis-lit-langchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceramicstudio%2Forbis-lit-langchain/lists"}