Credentials. Your Pinecone and OpenAI keys go into the app bundle under this demo setup, so limit their scope and rotate them after testing.
Who it is forA developer or product team with their own documentation who wants a mobile assistant that answers only from that content.
The problemBuilding a retrieval-backed chat that answers only from a specific body of text means wiring a streamed model, a search tool, and a mobile UI together.
The outcomeThe assistant answers questions from your index, and the answers draw on the retrieved text instead of the model's memory.
What you need first
- Xcode and CocoaPods for iOS, or the Android setup from the React Native environment guide
- Node 22.11 or newer
- An OpenAI API key
- A Pinecone API key, a populated Pinecone index, and its index host
Steps
- Create a Pinecone index with integrated embedding and load your text into it, since the README says raw text goes up and Pinecone embeds it server-side.
- Open
src/config.tsand set the Pinecone key and your new index host. - Read
app/src/rag/searchKnowledgeBase.tsand update the system behavior that tells the model to answer Margelo questions only from retrieved context, changing the topic to your own. - Run
npm run typecheckto confirm the changes compile. - Run
npm run iosornpm run androidand test questions that you know the index can answer.
Prompt for your agent
In the margelo/ai-chat-demo repo, change the knowledge base search to use the Pinecone index host <your index host> and adjust the retrieval instructions for <your topic>. Run npm run typecheck and report the result, then ask one question you know the index answers and confirm the reply uses retrieved text.
Caveat. The README does not describe how to populate the index, so the content loading step depends on your own Pinecone process.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for margelo/ai-chat-demo and "Point the knowledge base tool at your own Pinecone index"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer