Build grounded chat, synced knowledge bases, and graph-aware applications with Graphlit.
Graphlit is the context layer for AI applications and agents. This repo gives developers and coding agents the canonical Graphlit path: ingest or sync content, wait for processing, retrieve explicit evidence, and stream grounded answers with streamAgent().
Use the Skill · Run the Example · Read the Docs · Open Graphlit Studio
When a developer asks an agent to "add Graphlit", the result should use Graphlit primitives instead of drifting into generic RAG scaffolding.
This repo provides:
- a reusable
graphlitskill that routes the agent to the right Graphlit references - a reusable
durable-cliskill that teaches coding agents how to install, authenticate, connect source accounts, manage synced data sources, and operate Durable Agents from the terminal - a minimal Next.js example that proves the modern Graphlit app shape
- task-specific implementation guides for ingestion, retrieval, collections, feeds, specifications, and knowledge graph workflows
- grounded chat over documents, websites, notes, transcripts, and synced external content
- customer-scoped or workspace-scoped assistants using collections
- continuously synced knowledge bases from Slack, Google Drive, email, RSS, S3, and web crawls
- graph-aware applications that extract entities and relationships during ingest
- Verify credentials with
getProject(). - Ingest content with
ingestUri()or sync a source withcreateFeed(). - Wait for
isContentDone()orisFeedDone()before retrieval depends on new content. - Scope retrieval with a collection when the app has a clear dataset, tenant, customer, project, or workspace boundary.
- Use
streamAgent()as the chat harness. - Keep retrieval explicit through a standalone
retrieve_contentstool backed byretrieveSources()andlookupContents(). - Return and render visible sources in the UI.
The reusable Graphlit skill and its task-specific references. Start with SKILL.md when the goal is to integrate Graphlit into an application or have a coding agent do it correctly.
The reusable Durable CLI skill and its walkthrough references. Start with SKILL.md when the goal is to install, authenticate, connect source accounts, manage data sources, script, or operate Durable Agents from a terminal using the current command surface.
The canonical sample app for this repo. It shows:
- URL ingestion with
ingestUri() - readiness polling with
isContentDone() - collection-scoped retrieval
streamAgent()with a standaloneretrieve_contentstool- streamed answers with visible sources
- Open Graphlit Studio.
- Create your account, organization, and first project.
- Select that project so its project card is visible.
- Choose the target environment tab, usually
PrevieworProduction. - Click
Copy Environment Variables. - Paste the copied values into
.env.local. - Add
OPENAI_API_KEYfor the streaming example.
cd examples/nextjs-streaming-chat
npm install
cp .env.example .env.local
npm run check
npm run devOpen http://localhost:3000.
- the app connects to the intended Graphlit project
- a URL ingests successfully
- retrieval waits for content readiness
- the agent calls
retrieve_contents - the answer streams incrementally
- the UI shows the supporting sources
- prefer Graphlit SDK primitives over generic RAG stacks
- keep retrieval explicit and inspectable
- do not rely on newly ingested or newly synced content until Graphlit says it is ready
- keep examples small enough to copy into real apps quickly
The goal is to make Graphlit easy to adopt without hiding how Graphlit actually works.