Track C: RAG and vector memory

Track C walks through document ingestion, vector memory configuration, and query runs that emit MemoryRetrieved trace events. You use Qdrant plus embedding configuration (stub or real provider).

Goal

Ingest documents, query via a vector-memory agent, and verify retrieval in execution traces. First contact with Qdrant, embedding env vars, and hybrid retrieval settings.

Prerequisites

ItemRequired
Track ACompleted or equivalent SDK familiarity
Python SDKBuilt
QdrantARCFLOW_QDRANT_URL (e.g. dev stack on port 6333)
Primary exampleRAG chatbot example
ScriptRAG chatbot walkthrough
GuidesVector RAG pipeline, knowledge ingestion

Stub-only path works without Qdrant but will not emit MemoryRetrieved until documents exist in the store.

If your dev compose includes Qdrant, start it with the server stack or standalone container on port 6333. Export:

bash
export ARCFLOW_QDRANT_URL=http://localhost:6333

Step 2: Configure memory on an agent

Use the sample from document_qa.py:

python
memory = MemoryConfig(
 MemoryType.VECTOR,
 MemoryScope.AGENT,
 namespace="track_c_kb",
 embedding="stub/8", # swap for production embedding id
 retrieval=MemoryRetrievalConfig(
 mode="hybrid",
 dense_weight=0.7,
 sparse_weight=0.3,
 top_k=3,
 ),
 chunking=MemoryChunkingConfig(chunk_size=256, overlap=32),
)
agent = Agent(name="researcher", role="researcher", instructions="Answer using retrieved context.", memory=memory)
workflow = Workflow(name="track-c-rag", agents=[agent])

Change namespace to a dedicated track id to avoid colliding with other tutorials.

Step 3: Ingest sample documents

Ingest text into namespace track_c_kb using admin ingest API, dashboard Knowledge tab, or SDK ingest helpers described in knowledge ingestion.

Minimal text for verification:

text
ArcFlow hybrid retrieval combines dense vectors with sparse signals.
Chunk size and overlap affect recall on long documents.

Confirm ingest success before querying.

Step 4: Run query

bash
python examples/rag/document_qa.py

Or inline:

python
result = workflow.run("What does ArcFlow use for hybrid retrieval?")
print(result.output)

Step 5: Verify trace events

python
kinds = {e.get("event_kind") for e in result.trace_events}
assert "MemoryRetrieved" in kinds, f"missing MemoryRetrieved; got {kinds}"
assert result.status == "completed"
print("track C trace checks passed")

Inspect MemoryRetrieved payloads for chunk counts and scores without chunk text (trace data policy).

Verification checklist

CheckExpected
IngestNamespace populated
result.statuscompleted
MemoryRetrievedPresent on query run
WorkflowCompletedPresent
AnswersReference ingested facts when using real provider

Expected output

Non-empty answer string referencing hybrid retrieval concepts when the store is populated. Verification prints track C trace checks passed.

Troubleshooting

SymptomLikely causeFix
No MemoryRetrievedNo ingest or wrong namespaceRe-ingest into track_c_kb
Qdrant connection refusedService not runningStart Qdrant; verify URL
Generic stub answerStub path without storeExpected until ingest completes
Poor recallChunk settingsTune chunk_size and overlap per guide

What you learned

Track C connects agent memory configuration to operational ingest and trace-verified retrieval. Platform RAG features in static product and server admin APIs build on the same vector primitives.

Next tracks

TrackFocus
DGraph routing
FStatic product with dashboard-ingested knowledge
Level 2 certRAG plus graph plus HITL combined project