Hello World
Ingesting code into Qdrant
This example demonstrates how to ingest the Swiftide codebase itself. Note that for it to work correctly you need to have OPENAI_API_KEY set, redis and qdrant running.
The pipeline will:
- Load all
.rs
files from the current directory - Skip any nodes previously processed; hashes are based on the path and chunk (not the metadata!)
- Run metadata QA on each chunk; generating questions and answers and adding metadata
- Chunk the code into pieces of 10 to 2048 bytes
- Embed the chunks in batches of 10, Metadata is embedded by default
- Store the nodes in Qdrant
Note that metadata is copied over to smaller chunks when chunking. When making LLM requests with lots of small chunks, consider the rate limits of the API.
Find more examples in our repository