Document Store — Manage Vector Knowledge Bases
Create and manage Forjinn document stores: upload and chunk documents, configure vector store and embeddings, run semantic search, and track ingestion jobs.
Document stores are the knowledge bases that power RAG (Retrieval-Augmented Generation) in your chatflows. A document store holds one or more document loaders, processes their content into chunks, embeds those chunks, and upserts them into a vector store. You can then connect a document store to any chatflow to give it access to that knowledge.
Document store statuses
| Status | Meaning |
|---|---|
EMPTY | Newly created, no documents loaded |
NEW | Documents added but not yet processed |
SYNC | Fully processed and up to date |
SYNCING | Processing in progress |
STALE | Source documents have changed since last sync |
UPSERTING | Embedding and inserting into the vector store |
UPSERTED | Successfully upserted into the vector store |
The document store object
idstringUUID of the document store.
namestringDisplay name.
descriptionstringHuman-readable description of this store's contents.
statusstringCurrent processing status (see table above).
loadersarrayArray of configured document loaders. Each loader describes a data source, its chunking splitter, and its sync state.
totalChunksintegerTotal number of document chunks across all loaders.
totalCharsintegerTotal character count across all chunks.
vectorStoreConfigobjectConfiguration of the connected vector store provider.
embeddingConfigobjectConfiguration of the embedding model.
whereUsedarrayChatflows that reference this document store.
createdDatestringISO 8601 creation timestamp.
updatedDatestringISO 8601 last-updated timestamp.
Create a document store
POST /api/v1/document-store/storenamestringRequiredDisplay name for the document store.
descriptionstringOptional description of the store's contents.
curl -X POST https://your-forjinn-instance.com/api/v1/document-store/store \
-H "Authorization: Bearer fj-abc123def456" \
-H "Content-Type: application/json" \
-d '{
"name": "Product Documentation",
"description": "Forjinn user guides and API reference content."
}'const response = await fetch('https://your-forjinn-instance.com/api/v1/document-store/store', {
method: 'POST',
headers: {
'Authorization': 'Bearer fj-abc123def456',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Product Documentation',
description: 'Forjinn user guides and API reference content.',
}),
});
const store = await response.json();Response — 200 OK
{
"id": "c3d4e5f6-a7b8-9012-cdef-012345678901",
"name": "Product Documentation",
"description": "Forjinn user guides and API reference content.",
"status": "EMPTY",
"loaders": [],
"totalChunks": 0,
"totalChars": 0,
"whereUsed": [],
"createdDate": "2024-05-01T10:00:00.000Z",
"updatedDate": "2024-05-01T10:00:00.000Z"
}List document stores
GET /api/v1/document-store/storeReturns all document stores in your active workspace.
curl https://your-forjinn-instance.com/api/v1/document-store/store \
-H "Authorization: Bearer fj-abc123def456"const response = await fetch('https://your-forjinn-instance.com/api/v1/document-store/store', {
headers: { 'Authorization': 'Bearer fj-abc123def456' },
});
const stores = await response.json();Response — 200 OK — array of document store objects.
Get a document store
GET /api/v1/document-store/store/:ididstringRequiredUUID of the document store.
curl https://your-forjinn-instance.com/api/v1/document-store/store/c3d4e5f6-a7b8-9012-cdef-012345678901 \
-H "Authorization: Bearer fj-abc123def456"const id = 'c3d4e5f6-a7b8-9012-cdef-012345678901';
const response = await fetch(`https://your-forjinn-instance.com/api/v1/document-store/store/${id}`, {
headers: { 'Authorization': 'Bearer fj-abc123def456' },
});
const store = await response.json();Response — 200 OK — single document store object including loader details.
Update a document store
PUT /api/v1/document-store/store/:ididstringRequiredUUID of the document store to update.
namestringUpdated display name.
descriptionstringUpdated description.
curl -X PUT https://your-forjinn-instance.com/api/v1/document-store/store/c3d4e5f6-a7b8-9012-cdef-012345678901 \
-H "Authorization: Bearer fj-abc123def456" \
-H "Content-Type: application/json" \
-d '{
"description": "All product documentation including changelogs."
}'const id = 'c3d4e5f6-a7b8-9012-cdef-012345678901';
const response = await fetch(`https://your-forjinn-instance.com/api/v1/document-store/store/${id}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer fj-abc123def456',
'Content-Type': 'application/json',
},
body: JSON.stringify({ description: 'All product documentation including changelogs.' }),
});
const updated = await response.json();Delete a document store
DELETE /api/v1/document-store/store/:ididstringRequiredUUID of the document store to delete.
Deleting a document store removes all its loaders, chunks, and vector store configuration. Chatflows connected to this store will lose their knowledge base.
curl -X DELETE https://your-forjinn-instance.com/api/v1/document-store/store/c3d4e5f6-a7b8-9012-cdef-012345678901 \
-H "Authorization: Bearer fj-abc123def456"const id = 'c3d4e5f6-a7b8-9012-cdef-012345678901';
await fetch(`https://your-forjinn-instance.com/api/v1/document-store/store/${id}`, {
method: 'DELETE',
headers: { 'Authorization': 'Bearer fj-abc123def456' },
});
// 200 OK on successQuery the vector store
Run a semantic similarity search against a document store's embedded content.
POST /api/v1/document-store/vectorstore/querystoreIdstringRequiredUUID of the document store to query.
querystringRequiredThe natural-language query to search for.
topKintegerNumber of results to return (default: 4).
curl -X POST https://your-forjinn-instance.com/api/v1/document-store/vectorstore/query \
-H "Authorization: Bearer fj-abc123def456" \
-H "Content-Type: application/json" \
-d '{
"storeId": "c3d4e5f6-a7b8-9012-cdef-012345678901",
"query": "How do I configure rate limiting?",
"topK": 5
}'const response = await fetch('https://your-forjinn-instance.com/api/v1/document-store/vectorstore/query', {
method: 'POST',
headers: {
'Authorization': 'Bearer fj-abc123def456',
'Content-Type': 'application/json',
},
body: JSON.stringify({
storeId: 'c3d4e5f6-a7b8-9012-cdef-012345678901',
query: 'How do I configure rate limiting?',
topK: 5,
}),
});
const results = await response.json();Response — 200 OK
[
{
"pageContent": "Rate limiting can be configured per chatflow in Settings → Rate Limits. Set a maximum number of requests per minute...",
"metadata": {
"source": "admin-guide.pdf",
"page": 12,
"chunkNo": 3
},
"score": 0.91
},
{
"pageContent": "To prevent abuse, each chatflow has an independent rate limit. The default is 100 requests per minute.",
"metadata": {
"source": "api-reference.md",
"chunkNo": 7
},
"score": 0.87
}
]Check processing job status
Document ingestion (chunking and upserting) is asynchronous. Use this endpoint to poll for the status of a processing job.
GET /api/v1/document-store/job-status/:jobIdjobIdstringRequiredThe job ID returned when you initiated a processing or upsert operation.
curl https://your-forjinn-instance.com/api/v1/document-store/job-status/job-abc-123 \
-H "Authorization: Bearer fj-abc123def456"const jobId = 'job-abc-123';
const response = await fetch(
`https://your-forjinn-instance.com/api/v1/document-store/job-status/${jobId}`,
{ headers: { 'Authorization': 'Bearer fj-abc123def456' } }
);
const status = await response.json();Response — 200 OK
{
"jobId": "job-abc-123",
"status": "COMPLETED",
"totalChunks": 248,
"processedChunks": 248
}Poll this endpoint until status is COMPLETED or FAILED before treating the store as ready to query.
Agent Flows API: Manage Multi-Agent Pipelines
Create, retrieve, update, and delete Forjinn agent flows — multi-step AI pipelines supporting AutoADK, AutoGen, CrewAI, and native agent orchestration.
Triggers API: Create and Manage Automations
Automate Forjinn chatflow executions with cron-based schedules or incoming webhooks from Telegram, Slack, and other platforms, and retrieve execution results.